home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / pgs3f.lha / 3.0fUpdate / Macros.LHA / AutomaticTextFrame.rexx < prev    next >
OS/2 REXX Batch file  |  1994-12-04  |  2KB  |  64 lines

  1. /* $VER: AutomaticTextFrame.rexx 1.0a (04.12.94)
  2.    Copyright 1994 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. OPTIONS RESULTS
  6. TRACE OFF
  7.  
  8. /* Make sure rexx support is opened */
  9. IF ~SHOW('L','rexxsupport.library') THEN
  10.    CALL ADDLIB('rexxsupport.library',0,-30)
  11.  
  12. ADDRESS 'PAGESTREAM'
  13.  
  14. /* Check and see if a text frame is selected */
  15. 'getcursor type objtype'
  16. if RC>0 | objtype='TEXTOBJ' then do
  17.     allocarexxrequester '"Automatic Text Frame Error!"' 524 51
  18.     reqhandle=result
  19.     addarexxgadget reqhandle EXIT 442 34 70 label "_Exit"
  20.         Exithandle=result
  21.     addarexxgadget reqhandle TEXT 8 10 504 border none string "'The insertion point must be in a text frame to use this macro.'"
  22.     doarexxrequester reqhandle
  23.     freearexxrequester reqhandle
  24.     EXIT
  25. end
  26.  
  27. /* Find how many frames are in the article, and the current frame's ID */
  28. 'getcursor framestart framecursor'
  29. 'getarticle frames fstem'
  30. framecount=fstem.count
  31. framecursor=framecursor+1
  32. currentframe=fstem.framecursor
  33. lastframe=fstem.framecount
  34.  
  35. /* Check that there are no linked frames after the current frame */
  36. if currentframe~=lastframe then do
  37.     allocarexxrequester '"Automatic Text Frame Error!"' 444 51
  38.     reqhandle=result
  39.     addarexxgadget reqhandle EXIT 362 34 70 label "_Exit"
  40.         Exithandle=result
  41.     addarexxgadget reqhandle TEXT 8 10 424 border none string "'There are linked text frames after the current one!.'"
  42.     doarexxrequester reqhandle
  43.     freearexxrequester reqhandle
  44.     EXIT
  45. end
  46.  
  47. /* Get Info on the current frame */
  48. 'refresh wait'
  49. getcolumn position pstem columns number gutter space rotation rstem about rstem constrain cflag print pflag
  50.  
  51. /* Create the new frame */
  52. pstring=pstem.left' 'pstem.top' 'pstem.right' 'pstem.bottom' skew 'rstem.slant' 'rstem.twist' columns 'number' gutter 'space
  53. if rstem.mode=POINT then pstring=pstring' about 'rstem.x' 'rstem.y
  54. if cflag=ON then pstring=pstring' constrain'
  55. if pflag=OFF then pstring=pstring' noprint'
  56. getdisplay dstem
  57. display page dstem.page+1
  58. 'drawcolumn 'pstring
  59. newframe=result
  60.  
  61. /* Link the frames */
  62. 'settextrouting from objectid 'currentframe' to objectid 'newframe
  63. 'refresh continue'
  64.